﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cspl.Calculator.Lib;
using Cspl.Calculator.Lib.Model;

namespace Cspl.Calculator.Main
{
    class Program
    {
        static void Main(string[] args)
        {
            MainCalculator calculator = new MainCalculator();
            CalModel data1 = new CalModel()
            {
                IntegerValue1 = 100,
                IntegerValue2 = 4,
                ListOfIntegerValue = new List<int>(){100,2,3,4,5,6,7,8,9,10},
                Operation = CalOperations.Mul,
                Mode = CalMode.List
            };
            //CalModel data2 = new CalModel(CalOperations.Mul);

            //data1.IntegerValue1 = 20;
            //data1.IntegerValue2 = 14;
            //data1.Operation = "Add";

            //data2.IntegerValue1 = 20;
            //data2.IntegerValue2 = 2;

            calculator.Data = data1;

            try
            {
                int result = calculator.Calculate();

                Console.WriteLine("result : " + result);
            }
            catch (Exception ex)
            {
                Console.WriteLine("An exception occured : " + ex.Message);
            }

            Console.ReadKey();
            
        }
    }
}
